import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import vuetify from './plugins/vuetify';
import VConsole from 'vconsole'
import VueCookies from 'vue-cookies'

import Mint from 'mint-ui'
import 'mint-ui/lib/style.css'

import axios from 'axios'
import VueAxios from 'vue-axios'

import VueI18n from 'vue-i18n'
import { zh_cn } from './locale/zh_cn'
import { zh_hk } from './locale/zh_hk'
import { en_us } from './locale/en_us'
import HeadBack from '@/components/new/HeadBack'

Vue.component("hBack", HeadBack)

Vue.use(VueI18n)


export const hl = (variable = 'hl') => {
  var arrStr = window.location.search.substring(1).split("&");
  for (var i = 0; i < arrStr.length; i++) {
    var temp = arrStr[i].split("=");
    if (temp[0] === variable){
        return decodeURIComponent(temp[1])
    }    
  }
  return "zh_cn"
}

const lang = hl("hl")

const i18n = new VueI18n({
  locale: lang,
  messages:{
    'zh_cn':zh_cn,
    'zh_hk':zh_hk,
    'en_us':en_us,
  },
})

Vue.use(VueCookies)

Vue.use(VueAxios, axios)

Vue.use(Mint);

Vue.config.productionTip = false

new VConsole()

new Vue({
  router,
  store,
  i18n,
  vuetify,
  render: h => h(App)
}).$mount('#app')
